package com.itheima.animaldemo;

public class Test {

    public static void main(String[] args) {
       /*
       //抽象类不能直接new  有方法没有说清楚
       Animal animal = new Animal();
        animal.drink();
        animal.eat();*/
        Dog dog = new Dog();
        dog.drink();
        dog.eat();
        Cat cat = new Cat();
        cat.eat();
        cat.drink();

    }
}

abstract class Animal {
    public void drink() {
        System.out.println("喝水");
    }

    public abstract void eat();
}

class Dog extends Animal {

    @Override
    public void eat() {
        System.out.println("狗吃狗粮");
    }
}

class Cat extends Animal {

    @Override
    public void eat() {
        System.out.println("猫吃猫粮");
    }
}